﻿using System;
using System.Collections.Generic;
using System.Text;
using FunctionalCLR.Core;
using FunctionalCLR.Shell;

namespace Zove.Numerics.Core {
    public class ZoveNumericsDependencyManager {

        private IParserFactory cpf = null;

        private IFunctionManager cfm = null;

        public IContext Context {
            get;
            set;
        }

        public ZoveNumericsDependencyManager(IContext context) {
            this.Context = context;

            this.cfm = new ContextFunctionManager(context);
            this.cpf = new ZoveNumericsParserFactory(context);
        }

        public static ZoveNumericsDependencyManager Instance {
            get;
            set;
        }

        public IFunctionManager FunctionManager {
            get {
                return cfm;
            }
        }

        public IConstantManager ConstantManager {
            get {
                return DefaultDependencyManager.Instance.ConstantManager;
            }
        }

        public IExpressionCompiler ExpressionCompiler {
            get {
                return DefaultDependencyManager.Instance.ExpressionCompiler;
            }
        }

        public IParserFactory ParserFactory {
            get {
                return this.cpf;
            }
        }
    }
}
